package com.stringbuffer_;

/**
 * @Author 小闽
 * @Date 2024/10/2 11:27
 * @PackageName: com.stringbuffer_
 * @ClassName: StringBufferExercise
 * @Description: StringBuffer练习
 * @Version 1.0
 */
public class StringBufferExercise {
    public static void main(String[] args) {
        String str = null;
        StringBuffer sb = new StringBuffer();
        sb.append(str); // 看源码
        System.out.println(sb.length()); // 4
        System.out.println(sb);  // null
        StringBuffer sb1 = new StringBuffer(str);
        System.out.println(sb1);
    }
}
